/*
 * COPYRIGHT:	2010 Christopher Smith, licenced under the GNU GPL v2; see COPYING in the top level directory
 * PROJECT:		sdedit
 * FILE:		cast.cpp
 * PURPOSE:		other methods of type casting, in C++ style format
 *				
 */

template <class D, class S> FORCEINLINE D c_cast(S x)
{
	return (D)x;
};

template <class D, class S> FORCEINLINE D union_cast(S x)
{
	union
	{
		S s;
		D d;
	};
	s = x;
	return d;
}

template <class D, class S> FORCEINLINE D &ref_cast(S &x)
{
	return *((D *)&x);
}